package cd.casic.server.controller;

import cd.casic.server.entity.JenkinsPlugin;

import cd.casic.server.service.JenkinsPluginInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/api/jenkins-plugin-info")
public class JenkinsPluginInfoController {

    @Autowired
    private  JenkinsPluginInfoService jenkinsPluginInfoService;




    @GetMapping
    public List<JenkinsPlugin> getAllInstalldePluginInfos() throws IOException {
        return jenkinsPluginInfoService.listAllInstalldePluginInfos();
    }

    @GetMapping
    public List<JenkinsPlugin> getAllAvailablePluginInfos() throws IOException {
        return jenkinsPluginInfoService.listAllAvailablePluginInfos();
    }


}